package org.creativor.rayson.transport.stream;

import java.io.DataInputStream;
import java.io.IOException;
import java.io.PipedInputStream;
import org.creativor.rayson.api.TransferSocket;
import org.creativor.rayson.transport.api.TimeLimitConnection;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * The class <code>DataStreamerTest</code> contains tests for the class
 * <code>{@link DataStreamer}</code>.
 * <p>
 * Copyright Creativor Studio (c) 2011
 * 
 * @generatedBy CodePro at 11-5-7 上午3:08
 * @author Nick Zhang
 * @version $Revision: 1.0 $
 */
public class DataStreamerTest {
	/**
	 * Launch the test.
	 * 
	 * @param args
	 *            the command line arguments
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(DataStreamerTest.class);
	}

	/**
	 * Perform pre-test initialization.
	 * 
	 * @throws Exception
	 *             if the initialization fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Before
	public void setUp() throws Exception {
		// TODO: add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 * 
	 * @throws Exception
	 *             if the clean-up fails for some reason
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@After
	public void tearDown() throws Exception {
		// TODO: add additional tear down code here
	}

	/**
	 * Run the void catchIOException(IOException) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testCatchIOException_1() throws Exception {
		DataStreamer fixture = new DataInputImpl(new DataInputStream(
				new PipedInputStream()), (TransferSocket) null,
				(TimeLimitConnection) null);
		IOException e = new IOException();

		fixture.catchIOException(e);

		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at
		// org.creativor.rayson.transport.stream.DataStreamer.catchIOException(DataStreamer.java:26)
	}

	/**
	 * Run the void catchIOException(IOException) method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testCatchIOException_2() throws Exception {
		DataStreamer fixture = new DataInputImpl(new DataInputStream(
				new PipedInputStream()), (TransferSocket) null,
				(TimeLimitConnection) null);
		IOException e = new IOException();

		fixture.catchIOException(e);

		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at
		// org.creativor.rayson.transport.stream.DataStreamer.catchIOException(DataStreamer.java:26)
	}

	/**
	 * Run the void touch() method test.
	 * 
	 * @throws Exception
	 * 
	 * @generatedBy CodePro at 11-5-7 上午3:08
	 */
	@Test
	public void testTouch_1() throws Exception {
		DataStreamer fixture = new DataInputImpl(new DataInputStream(
				new PipedInputStream()), (TransferSocket) null,
				(TimeLimitConnection) null);

		fixture.touch();

		// TODO: add additional test code here
		// An unexpected exception was thrown in user code while executing this
		// test:
		// java.lang.NullPointerException
		// at
		// org.creativor.rayson.transport.stream.DataStreamer.touch(DataStreamer.java:34)
	}
}